import request from '@/utils/request'

// 查询房屋列表
export function listHouse(query) {
  return request({
    url: 'pms/house/list',
    method: 'get',
    params: query
  })
}

// 新增房屋
export function addHouse(data) {
  return request({
    url: 'pms/house/add',
    method: 'post',
    data: data
  })
}

// 编辑房屋
export function updateHouse(data) {
  return request({
    url: 'pms/house/edit',
    method: 'put',
    data: data
  })
}

// 删除房屋
export function delHouse(id) {
  return request({
    url: `pms/house/${id}`,
    method: 'delete'
  })
}

// 查询小区列表（用于房屋新增/编辑选择小区）
export function listCommunity(query) {
  return request({
    url: 'pms/community/list',
    method: 'get',
    params: query
  })
}
